package com.lj.eduservice.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@Api("模拟用户")
@RestController
@RequestMapping("/mock/user")
public class MockLoginController {

    @PostMapping("/login")
    @ApiOperation("模拟登录")
    public Map<String, String> login() {
        HashMap<String, String> map = new HashMap<>();
        map.put("token", "admin");
        return map;
    }

    @ApiOperation("用户信息")
    @GetMapping("/info")
    public Map info() {
        HashMap<String, String> map = new HashMap<>();
        map.put("roles", "[admin]");
        map.put("name", "admin");
        map.put("avatar", "https://guli-file-190513.oss-cn-beijing.aliyuncs.com/avatar/default.jpg");
        return map;
    }
}
